home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX 6.5 Applications 2004 April
/
SGI IRIX 6.5 Applications 2004 April.iso
/
dist
/
appletalk.idb
/
usr
/
etc
/
appletalk
/
getpreview.z
/
getpreview
Wrap
Text File
|
2002-03-07
|
2KB
|
67 lines
#!/bin/csh -f
# @(#)getpreview 10.1 99/10/14 Xinet, Inc.
# Copyright (c) 1998 by Xinet, Inc. All Rights Reserved.
# xkspool RIP script that finds "Preview" programs on the local machine
# wherever they might live.
#
set op = list
set item = ""
if ($#argv > 0) then
if ("$1" == get) then
set op = get
if ($#argv < 2) exit 1
set item = "$2"
else if ("$1" == ppd) then
set op = ppd
if ($#argv < 2) exit 1
set item = "$2"
else if ("$1" != list) then
exit 1
endif
endif
set rips = ( showps ghostview pageview xpsview )
set names = ( "SGI Screen Preview" "GhostScript" "SUN Screen Preview" "SGI Display Preview" )
set ppds = ( XPSVIEW2.PPD GS.PPD SPARC.PPD XPSVIEW.PPD )
set ripopt = ( "-igc -" - "-timeout 120 -" "-igc -" )
set nonomatch
set dirlist = ( /usr/bin/X11 /usr/X*/bin /usr/openwin/bin /usr/bin \
/usr/local/bin /usr/local /usr/new /usr/etc/appletalk /usr/freeware/bin )
set f = 1
while ($f <= $#rips)
if ($op != list) then
if ("$names[$f]" != "$item") then
@ f = $f + 1
continue
endif
if ($op == ppd) then
if (-r /usr/adm/appletalk/ppds/$ppds[$f]) then
echo /usr/adm/appletalk/ppds/$ppds[$f]
endif
exit 0
endif
endif
set d = 0
if ($?gotshowps && "$rips[$f]" == "xpsview") then
@ f = $f + 1
continue
endif
while ($d <= $#dirlist)
if (-x "$dirlist[$d]/$rips[$f]") then
if ($op == get) then
echo "$dirlist[$d]/$rips[$f] $ripopt[$f]"
exit 0
endif
echo cmd:$names[$f]
if ("$rips[$f]" == "showps") set gotshowps = 1
break
endif
@ d = $d + 1
end
if ($op != list) exit 1
@ f = $f + 1
end
if ($op != list) exit 1
exit 0